package cn.edu.zafu.bigdata.x.wupeng.c;

public class Person {
    private String name;
    private int age;
    private int hp;
    private static int count=0;

    public static int getCount() {
        return count;
    }

    public Person(String name){
        this.name=name;
        count++;
        System.out.println("Person构造方法被执行");
    }
    public Person(String name, int age){
        this.name=name;
        this.age=age;
        count++;
    }
    public Person(String name, int age,int hp){
        this.name=name;
        this.age=age;
        this.hp=hp;
        count++;
    }
    public Person(int age){
        this.age=age;
        count++;
    }
    //写一个可用的析构方法

    public void Destroy(){
        System.out.println("销毁了");
        count--;
    }



    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void WhoAmI(){
        System.out.println("我是"+name+"，今年"+age+"岁");
    }

    public void Print(String name){
        System.out.println(name);
    }
    public void Print(int age){
        System.out.println(age);
    }


}
